<template>
  <div>
    <div @drop="drop($event)" @dragover="dragover($event)">
      
      拖放文件测试<br>
      拖放文件测试<br>
      拖放文件测试<br>

    </div>


  </div>
</template>

<style scoped>
</style>

<script>
  export default {
    name: '',
    //传参：父传子，写法：["形参1"[,"形参2"]]
    props: {

    },
    created() {

    },
    mounted() {

    },
    data() {
      return {

      }
    },
    methods: {
      drop($event){
        event.preventDefault();
        event.stopPropagation();

        for (const f of event.dataTransfer.files) {
          console.log('拖拽的文件：' + f.path)
        }
      },
      dragover($event){
        event.preventDefault();
        event.stopPropagation();
      }

    },
    mixins: [],
    components: {

    },
  }
</script>